package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.QQ;
import business.QQService;
import dao.QQDAO;

public class QQServiceImpl implements QQService {

	private QQDAO QQDao;

	public List<QQ> getAllQQs() {
		return QQDao.findAll();
	}

	public QQ getBySourceId(int sourceId) {
		return QQDao.findBySourceId(sourceId);
	}

	@Required
	public void setQQDao(QQDAO _QQDao) {
		QQDao = _QQDao;
	}

	@Transactional
	public void addQQ(QQ qq) {
		QQDao.create(qq);
	}

	@Transactional
	public QQ getById(long id) {
		return QQDao.getById(id);
	}

	@Transactional
	public void update(long id) {
		QQDao.update(id);
	}

	@Transactional
	public void delete(long id) {// 真正删除
		QQDao.delete(id);
	}

}